﻿using System;
using System.Collections.Generic;
using System.Text;
using TCKQKL.FrontEnd.DataModel;
using StockTrader.FrontEnd.DataContract;
using System.ComponentModel;
using StockTrader.BusinessService.DataContract.Mortgate;

namespace Mortgage.DDL
{
    public class StocksUI
    {
        public string Symbol { get; set; }
        public decimal Quantity { get; set; }
        public decimal Ref { get; set; }
        public decimal Value { get { return Quantity * Ref * 1000; } }
        public int TillSettlement { get; set; }
        public decimal AllowRate { get; set; }
        public string Name { get; set; }
        public decimal LoanAllowValue { get { return Quantity * Ref * 1000 * AllowRate; } }


        public StocksUI() { }
        public StocksUI(string symbol, decimal quantity, decimal refprice, decimal values, string name)
        {
            Symbol = symbol;
            Ref = refprice;
            Quantity = quantity;
            Name = name;

        }
        public StocksUI(string symbol, decimal quantity, decimal refprice, decimal values, decimal allowrate, string name)
        {
            Symbol = symbol;
            Ref = refprice;
            Quantity = quantity;
            Name = name;
            AllowRate = allowrate;
        }
        public StocksUI(string symbol, decimal quantity, decimal refprice, decimal values, int tillsettlement, decimal allowrate, string name)
        {
            Symbol = symbol;
            Ref = refprice;
            Quantity = quantity;
            Name = name;
            AllowRate = allowrate;
            TillSettlement = tillsettlement;
        }
        public StocksUI(StocksData item)
        {
            Symbol = item.Symbol;
            Ref = item.Ref;
            Quantity = item.Quantity;
            Name = item.Name;
            AllowRate = item.AllowRate;
            TillSettlement = item.TillSettlement;

        }

        public bool IsEquals(StocksUI item)
        {
            if ((item.Symbol.Equals(Symbol)) && (item.TillSettlement.Equals(TillSettlement)))
                return true;
            else
                return false;
        }
    }
}
